Repository navigation
feat(media,webview,engine): t8s3 MSE 音频能力面——AAC-in-MP4 双轨链路 + isTypeSupported 音频腿真值 - #137
Merged
Merged
Conversation
…upported 音频腿真值
bilibili 起播断链三角化定谳(决策日志直接证据):全部播放路径的合并 codec
探测 isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2") 因音频腿
恒 false 而失败 → fnval=1 降级 durl 直链 → flv-module 内核 attach 门(同款
探针)阻止 video.src 赋值。本切片补齐音频能力面:
- media: MseAudioFeed(共享缓冲 + 惰性 symphonia reader + 音频解码,边缘
语义与 MseVideoFeed 同构:增长重建/ended 真流末/读边缘归一;pts 取包
真值 + skip 相防重建重放)。钉④渐进双轨 + 钉⑤ fragmented 音频-only
DASH 形态(素材经 symphonia 自身 demux 提取)。
- webview: mse_audio_feeds(audio SourceBuffer 独立字节流)+ mse_append_audio
+ MseAudioEntry(sink/cursor/增益同 WebmAudioEntry 契约;None=等待面,
停止判定走 is_exhausted)+ play 懒建(audio feed 有字节才建,纯视频零
开销)+ mse_end 双 feed(endOfStream 为 MediaSource 级 op)+ audio clock
主时钟分支(entry 播放中才 sync,停止/缺席回落墙钟 tick)。facade
mseAppendAudio + __zw_ms_append_audio 回调。
- engine shim: isTypeSupported 音频腿真值(audio/mp4+AAC 与组合串逐 leg——
音频 leg 支持面 = mseAppendAudio 门面在位,能力诚实双向判别)+
addSourceBuffer audio/mp4 受理 + SourceBuffer 轨章 + appendBuffer 轨路由。
真站验证(bilibili BV1GJ411x7h7,decode-h264 构建):组合探针翻 true →
playurl fnval=16 DASH 选中(dash:1,此前恒 fnval=1 直链降级)→ 播放器
representation 级探测活跃(avc1.64001F/mp4a.40.5 → true)。残余:src 赋值
前内核 await 悬挂(EME 缺面候选),另切片处理。
测试:media 59P(+2)、webview video_registry 26P(+1)、engine 2987P
(+1;t8n 既有 MSE 钉读数不变)。门禁:fmt CLEAN、clippy workspace 默认
+ quickjs 双腿 -D warnings、make test exit 0。
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 4702c2f1-a7b6-48e6-8414-c72e7f6c0137) |
双审查首轮统一返修(①测试有效性 PASS 0 阻断;②缺陷 REQUEST_CHANGES 1 阻断): - B1(缺陷阻断):Ended→play 复活面音频条目随 reset 重建(feed 重置 + 游标 归零 + sink 重启)——修复重播音频死寂/游标冻结,对齐 M3 扩批 XXV 重头播放 契约的音频腿;新增复活面钉测(游标归零 + 泵恢复写入 + 重头推进)。 - N1(测试有效性缺口):重建跳相钉——读边缘 + 增长续段形态(生产 chunked append 触发面),断言重建后零重放 + 续段批数等价;音频续段构造器 (tfdt 偏移)随钉入列。 - N2:seek 覆盖 MSE 伴生音频(同句柄重建 feed + 游标/静默线对齐 target—— 播放中 seek 不再被主时钟回拉)。 - N3:audio_set_gain 覆盖 mse_audio_entries(同 clamp 契约)。 - N4:current_time 主时钟契约一致(mse 游标优先,同 av 面读序)。 - N5:shim 注释对齐 + audio SB 门面缺席路由改失败面(不写视频流)。 - N6:cursor 公式 saturating_add(pts 饱和值不进裸加法)。 - N7:双 feed 容量注记入 mse_append_audio 文档。 门禁:media 60P(+钉⑥)/ webview video_registry 27P(+复活钉)/ engine mse 2P / fmt CLEAN / clippy 双腿 -D warnings / make test exit 0。
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 52b0eb57-a603-4c74-8d1f-70650100f6b9) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变化
bilibili 起播断链三角化定谳(beacon 决策日志直接证据):站点全部播放路径的合并 codec 探测
MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2")因音频腿恒 false 而失败 → nano guard 选 fnval=1(传统 MP4 直链)→ flv-module 内核 attach 门(同一探针)阻止内核挂载 →video.src永不赋值 → load_timeout → ~57s disconnect/rebuild 周期。Chrome 同页 fnval=16 DASH 正常起播(blob src + currentTime 推进)。本切片补齐音频能力面(共享路径,无站点特判):
MseAudioFeed——audio SourceBuffer 独立字节流(DASH 音轨独立 init/media 段)的流式解码器。边缘语义与MseVideoFeed同构(增长重建 /ended真流末 / 读边缘归一);轨选择取 symphonia registry 可解音轨(aac+isomp4 features 已在 workspace 依赖);pts 取包真值非帧计数推导(重建后时间轴不回跳)+ skip 相防重放。mse_audio_feeds(双 feed 面)+mse_append_audio+MseAudioEntry(sink/cursor/增益契约同WebmAudioEntry;next_batchNone=等待面而非流末,停止判定走is_exhausted)+ play 懒建(audio feed 有字节才建——纯视频零开销)+mse_end双 feed(spec endOfStream 是 MediaSource 级 op)+ audio clock 主时钟分支(entry 播放中才 sync 视频位置,停止/缺席回落墙钟 tick,t8n 单轨形态零回归)。facademseAppendAudio+__zw_ms_append_audio回调。isTypeSupported音频腿真值——audio/mp4+AAC 与组合串逐 leg 判定,音频 leg 支持面 =mseAppendAudio门面在位(能力诚实:旧宿主/无解码链构建下读数不变 false);addSourceBuffer受理 audio/mp4;SourceBuffer轨章 +appendBuffer轨路由(audio → 独立音频流)。验证
avc1.42E01E,mp4a.40.2→ true(修复前 false);dash:1(fnval=16 DASH 选中),此前恒fnval=1+ durl 直链降级;avc1.64001F/mp4a.40.5→ true,清晰度菜单 avc1 全系 true。mseAppendAudio四查询全 false / 有则组合探针翻 true + opus/复合 vp9 恒 false + 双 SB 路由video:4,audio:4);t8n 既有 MSE 钉读数逐字符不变。test_pipeline_deeply_nested_html栈溢出为 main 基线既有——stash 对照实证,与本 PR 无关);make testexit 0。审查状态(head ea4577a)
已知边界(诚实披露)
new MediaSource()+URL.createObjectURL已成功,src 赋值前内核 await 悬挂(navigator.requestMediaKeySystemAccess缺面/EME 候选,证据留档)。本切片交付 = 音频能力面 + DASH 路径解锁,起播归下一切片。返修(双审查统一返修,ea4577a9f)
双首轮:①测试有效性 PASS(0 阻断,5 次变异验证判别力,2 覆盖缺口建议);②实现缺陷 REQUEST_CHANGES(1 阻断 + 7 非阻断)。统一返修(非作者复核 APPROVE,删除即红变异三重证据):
返修后门禁:media 60P(+钉⑥)/ webview video_registry 27P(+复活钉)/ engine mse 2P / fmt CLEAN / clippy 双腿 / make test exit 0。
截图
无适用画面(能力面/网络层切片,无视觉差异;决策日志与读数证据在审查档案)。
Note
Medium Risk
Touches MSE playback, media clock sync, and capability probing on a critical path for site playback; changes are gated behind decode-h264 and existing video MSE patterns but add substantial new streaming decode and registry state.
Overview
Adds MSE audio-track support so DASH-style dual-buffer playback (e.g. bilibili combined
avc1 + mp4a.40.2probes) can succeed instead of always failing on the audio leg.Media introduces
MseAudioFeed: a separate append buffer with symphonia AAC-in-MP4 streaming decode, matching video feed semantics (lazy probe, growth rebuild,endedexhaustion, PTS-based skip on rebuild).Webview wires a second feed via
mse_append_audio/mseAppendAudio,MseAudioEntryfor playback pump, dual-feedmse_end, and audio-as-master-clock video sync when the MSE audio entry is playing; play/pause/seek/gain follow existing A/V patterns.Engine shim marks
SourceBufferas video vs audio, routesappendBufferto video or audio bridge calls, and extendsMediaSource.isTypeSupportedforaudio/mp4+ AAC and per-codec legs in combined strings only whenmseAppendAudiois present (honest capability reporting).Coverage adds DOM bridge, feed, and registry integration tests (including
isTypeSupportedflip andvideo:4,audio:4routing).Reviewed by Cursor Bugbot for commit ea4577a. Bugbot is set up for automated code reviews on this repo. Configure here.